'Check to see if the Sprite hit a wall. If it did, reverse its velocity.
If .Location.x <= 0 Then
.Velocity.x = -1 * .Velocity.x
ElseIf .Location.x + .SpriteDimensions >= m_lClientWidth Then
.Velocity.x = -1 * .Velocity.x
End If
If .Location.y <= 0 Then
.Velocity.y = -1 * .Velocity.y
ElseIf .Location.y + .SpriteDimensions >= m_lClientHeight Then
.Velocity.y = -1 * .Velocity.y
End If
End With
End Sub
Private Function InitD3D(dx As DirectX8, d3d As Direct3D8, dev As Direct3DDevice8, ByVal hwnd As Long, Optional ByVal bWindowed As Boolean = True) As Long